<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>个人密码修改</title>
    </head>
    <body>
        <div id="form_password_info">
        </div>
        <script>
            Ext.onReady(function(){
                /*
                 * Ext.ux.ItemSelector Example Code
                 */
                tabs.getActiveTab().setTitle('个人密码修改');
                var oldPWD = new Ext.form.TextField({
                    fieldLabel: '旧密码',
                    allowBlank: false,
                    name: 'password',
                    inputType: 'password',
                    anchor: '90%'
                });
                
                var newPWD = new Ext.form.TextField({
                    fieldLabel: '新密码',
                    allowBlank: false,
                    name: 'new_password',
                    id: 'new_password',
                    inputType: 'password',
                    anchor: '90%'
                });
                
                var repeatPWD = new Ext.form.TextField({
                    fieldLabel: '重复新密码',
                    allowBlank: false,
                    name: 'repeat_password',
                    inputType: 'password',
                    vtype: 'password',
                    initialPassField: 'new_password',
                    anchor: '90%'
                });
                
                var formPasswordInfo = new Ext.form.FormPanel({
                    labelWidth: 80,
                    frame: true,
                    labelAlign: 'right',
                    width: 550,
                    url: '/web_user/setPasswordInfo',
                    items: [oldPWD, newPWD, repeatPWD],
                    buttons: [{
                        text: '确定',
                        handler: onItemClick //实际应用一般是处理fp.getForm.submit()事件   
                    }, {
                        text: '帮助',
                        handler: function(){
                            formPasswordInfo.getForm().reset();
                        }
                    }]
                });
                formPasswordInfo.render("form_password_info");
                function onItemClick(item){
                    if (formPasswordInfo.form.isValid()) {
                        formPasswordInfo.form.submit({
                            waitMsg: '正在提交......',
                            success: function(form, action){
								Ext.MessageBox.alert('消息', "密码修改成功！");
                            },
                            failure: function(form, action){
                                Ext.MessageBox.alert('提交错误消息', '提交失败');
                            }
                        });
                    }
                    else {
                        Ext.MessageBox.alert("提示", "请按要求填写带<span class='red'>*</span>的必输值！");
                    }
                }
            })
        </script>
    </body>
</html>
